package com.wt.admin.service.ai.impl.agents;

import com.wt.admin.domain.dto.ai.AgentsInfoDTO;
import com.wt.admin.domain.entity.ai.MCPEntity;
import com.wt.admin.domain.entity.ai.ModelConfigEntity;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class AgentsBuilderStrategy {

    final Map<String,AgentsBuilderService> map = new HashMap<>();

    @Autowired
    public AgentsBuilderStrategy(Map<String,AgentsBuilderService> agentsBuilderService) {
        this.map.putAll(agentsBuilderService);
    }

    public AgentsManager.ChatClientMapper builder(AgentsInfoDTO agents, ModelConfigEntity model, List<MCPEntity> mcpEntities){
        return map.get(model.getTag()).builder(agents,model,mcpEntities);
    }

}
